package gestiontienda.controller;


import java.util.HashMap;
import java.util.Map;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;

import com.opensymphony.xwork2.ActionSupport;
import gestiontienda.dataaccess.model.TrabajadorVO;
import javax.servlet.http.HttpSession;
import org.apache.struts2.ServletActionContext;

@ParentPackage(value = "gestiontienda")
public class GestionTienda extends ActionSupport {

    private static final long serialVersionUID = -7133848243722723891L;
    private String theme = "showcase";
    private boolean google = false;
    private boolean ajaxhistory = false;
    private Map<String, String> themes;
    private HttpSession session;

    @Action(value = "/index", results = {
        @Result(location = "usuario/bienvenido.jsp", name = "success"),
        @Result(location = "index.jsp", name = "error")
    })
    public String execute() throws Exception {
        System.out.println("La primera accion");
//        TrabajadorVO trabajadorVO = (TrabajadorVO) session.getAttribute("trabajador");
        if (1 == 1) {
            return ERROR;
        }
        return SUCCESS;
    }

    public String getTheme() {
        return theme;
    }

    public void setTheme(String theme) {
        this.theme = theme;
    }

    public Map<String, String> getThemes() {
        return themes;
    }

    public boolean isGoogle() {
        return google;
    }

    public void setGoogle(boolean google) {
        this.google = google;
    }

    public boolean isAjaxhistory() {
        return ajaxhistory;
    }

    public void setAjaxhistory(boolean ajaxhistory) {
        this.ajaxhistory = ajaxhistory;
    }
}
